<template>
  <div class="index">
     <Meun></Meun>
     <div class="content">
        <smartTable v-bind:get-message="tableData" v-on:receiveData="receiveData">
          <tr v-for="item in Data">
            <td>{{item.title}}</td>
            <td>{{item.class}}</td>
            <td>{{item.tag}}</td>
            <td>{{item.time}}</td>
            <td>{{item.author}}</td>
            <td>
              <button class="btn btn-info btn-xs">查看</button>
              <button class="btn btn-danger btn-xs">删除</button>
            </td>
          </tr>
        </smartTable>
      </div>
  </div>
</template>

<script>
import Meun from '../../components/menu.vue'
import smartTable from '../../components/smartTable.vue'
export default {
  components: {
    Meun,
    smartTable
  },
  data () {
    return {
      tableData: {
        'colTitle': ['title', 'classic', 'tag', 'time', 'author', 'operater'],
        'method': 'GET',
        'url': '/static/json/test.json',
        'query': { 'a': 1 }
      },
      Data: []
    }
  },
  methods: {
    receiveData (data) {
      this.Data = data
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.content{
    width:80%;
    margin-left:10%;
    margin-top:100px;
    background:white;
    padding:50px;
}
</style>
